//当前轮播图下标
	var swiperIndex=0
	//轮播图定时器
	var swiperTime=''
	//轮播图资源
	var swiperImg=[
		{
			img:'../img/shouye/home_banner.png'
		},
		{
			img:'../img/shouye/home_banner.png'
		},
		{
			img:'../img/shouye/home_banner.png'
		}
	]
	
	var swiper={
		getImg:getImg(),
		startSwiper:startSwiper()
	}
	//遍历添加轮播图
	function getImg(){
		for(var i=0;i<swiperImg.length;i++){
			$('.swiperImg').append('<li class="imgLi"><img class="imgs" src='+swiperImg[i].img+' ></li>')
			$('.pointUl').append('<li data-index='+i+' class="point"></li>')
		}
		//给第一个轮播图导航添加当前样式
		$('.point:eq('+swiperIndex+')').addClass('selectPoint')
	}
	//开始轮播图播放
	function startSwiper(){
		swiperTime=setInterval(function(){
			//获取每一页的宽度
			var liWidth=parseFloat($('.imgLi').css('width'))
			//获取当前轮播图的left值
			var liLeft=parseFloat($('.swiperImg').css('left'))
			swiperIndex++;
			//判断轮播图是否到最后一张
			if(swiperIndex<swiperImg.length){
				$('.swiperImg').css('left',liLeft-liWidth+'px')
			}else{
				swiperIndex=0;
				$('.swiperImg').css('left',0);
			}
			//轮播图导航样式变化
			$('.point').removeClass('selectPoint')
			$('.point:eq('+swiperIndex+')').addClass('selectPoint')
		},3000)
	}
	
	//开始
	swiper.getImg;
	swiper.startSwiper;
	//下标点击事件
	$('.point').on('click',function(e){
		//清除定时器
		clearInterval(swiperTime)
		//获取点击的下标值
		var idx=e.target.dataset.index;
		var liWidth=parseFloat($('.imgLi').css('width'))
		// 更换下标和当前页面
		swiperIndex=idx;
		$('.swiperImg').css('left',-idx*liWidth+'px')
		//更新轮播图导航样式
		$('.point').removeClass('selectPoint')
		$('.point:eq('+swiperIndex+')').addClass('selectPoint')
		//添加轮播图定时器
		startSwiper()
	})